package com.ibangnuo.manage.controller.alipay;

import com.ibangnuo.api.alipay.RefundControllerApi;
import com.ibangnuo.framework.domain.request.alipay.RefundRequest;
import com.ibangnuo.framework.model.response.ObjectResult;
import com.ibangnuo.framework.model.response.QueryResponseResult;
import com.ibangnuo.manage.service.alipay.RefundService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: wwy
 * @Date: 2019-12-22 13:54
 */
@RestController
@RequestMapping("/api/refund")
public class RefundController implements RefundControllerApi {
    @Autowired
    private RefundService refundService;

    /**
     * 分页查询退款表
     * @param page
     * @param size
     * @param refundRequest
     * @return
     */
    @PostMapping("/list/{page}/{size}")
    @Override
    public QueryResponseResult findList(@PathVariable("page") int page,@PathVariable("size") int size, @RequestBody RefundRequest refundRequest) {
        return refundService.findList(page,size,refundRequest);
    }

    /**
     * 根据id查找
     * @param id
     * @return
     */
    @GetMapping("/findById/{id}")
    @Override
    public ObjectResult findById(@PathVariable("id") String id) {
        return refundService.findById(id);
    }
}
